<?php
/**
 * @version 0.8.3 2010-10-07
 * @package Joomla
 * @subpackage LeagueResults
 * @copyright (C)  2008, 2009, 2010 Henryk Drozd
 * @license GNU/GPL, see LICENSE.php
 * LeagueResults is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License 2
 * as published by the Free Software Foundation.

 * LeagueResults is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
?>

<div class="componentheading">
<?php echo JText::_( 'FIXTURES OF THE ROUND' ); 
?>
</div>

<table class="roundlist" >
<tr>
	<th>
	<?php echo JText::_( 'SEASON' ).': '.$this->list[0]->name.' '.$this->list[0]->year; ?>
	<br>
	<?php echo JText::_( 'ROUND' ).': '.$this->list[0]->round; ?>
	</th>
</tr>

<?php foreach ($this->list as $match): ?>
<?php if (($match->results_quantity > 0)&&(JRequest::getVar('displayresults') == 'yes')) {
	if ($match->hscore > $match->vscore)
		$match->hteam = '<span class="wteam">'.$match->hteam.'</span>';
	if ($match->vscore > $match->hscore)
		$match->vteam = '<span class="wteam">'.$match->vteam.'</span>';
	if ($match->vscore == $match->hscore){
		$match->vteam = '<span class="draw">'.$match->vteam.'</span>';
		$match->hteam = '<span class="draw">'.$match->hteam.'</span>';
		}
	}
	?>
<tr><td><?php echo $match->formattedmatchdate; ?><br/>

		<?php switch (JRequest::getVar('links_ondisplay')){ 
				case 'none':
				default:
					echo $match->hteam;
					break;
				case 'team':
			?>
			    	<a href="<?php echo $match->hlink; ?>">
		        	<?php echo $match->hteam; ?></a>
			<?php 
					break;
				case 'club':
			?>
			    	<a href="<?php echo $match->hclublink; ?>">
		        	<?php echo $match->hteam; ?></a>
			<?php 
					break;
				case 'website':
			?>
			    	<a href="<?php echo $match->hurl; ?>">
		        	<?php echo $match->hteam; ?></a>
			<?php
					break;
			}
		?>

		<?php if (JRequest::getVar('badges_ondisplay') == 'default'?
					$this->settings->frontend_images:
					JRequest::getVar('badges_ondisplay') == 'yes') {?>
					<img src="<?php echo $this->settings->tbadge_folder.$match->htbadge; ?>" />
				<?php }?>
	
	:
		<?php if (JRequest::getVar('badges_ondisplay') == 'default'?
					$this->settings->frontend_images:
					JRequest::getVar('badges_ondisplay') == 'yes') {?>
					<img src="<?php echo $this->settings->tbadge_folder.$match->vtbadge; ?>" />
				<?php }?>
		<?php switch (JRequest::getVar('links_ondisplay')){ 
				case 'none':
				default:
					echo $match->vteam;
					break;
				case 'team':
			?>
			    	<a href="<?php echo $match->vlink; ?>">
		        	<?php echo $match->vteam; ?></a>
			<?php 
					break;
				case 'club':
			?>
			    	<a href="<?php echo $match->vclublink; ?>">
		        	<?php echo $match->vteam; ?></a>
			<?php 
					break;
					case 'website':
			?>
			    	<a href="<?php echo $match->vurl; ?>">
		        	<?php echo $match->vteam; ?></a>
			<?php
					break;
			}
		?>


<?php if (JRequest::getVar('displayresults') == 'yes') {?>

<?php if ($match->results_quantity > 0) { ?>
	<br/>
	<?php echo $match->hscore.' : '.$match->vscore; ?>
<?php } ?>
<?php if ($match->results_quantity > 1) { ?>
	<br/>(
	<?php echo $match->hscore1.' : '.$match->vscore1; ?>
<?php if ($match->results_quantity > 2) { ?>
	,&nbsp;
	<?php echo $match->hscore2.' : '.$match->vscore2; ?>
<?php } ?>
<?php if ($match->results_quantity > 3) { ?>
	,&nbsp;
	<?php echo $match->hscore3.' : '.$match->vscore3; ?>
<?php } ?>
<?php if ($match->results_quantity > 4) { ?>
	,&nbsp;
	<?php echo $match->hscore4.' : '.$match->vscore4; ?>
<?php } ?>
<?php if ($match->results_quantity > 5) { ?>
	,&nbsp;
	<?php echo $match->hscore5.' : '.$match->vscore5; ?>
<?php } ?>
<?php if ($match->results_quantity > 6) { ?>
	,&nbsp;
	<?php echo $match->hscore6.' : '.$match->vscore6; ?>
<?php } 
//following closing bracket of partial result
?>
)
<br/>
 <?php echo $match->description; ?>
<?php } ?>
<?php } ?>
	</td></tr>
<?php endforeach; ?>
</table>

